package Week4.J0506;

import java.util.Scanner;

public class 对称之美_xv {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int m = scanner.nextInt();
        while (m-- != 0) {
            int n = scanner.nextInt();
            boolean[][] hash = new boolean[n][26];

            for (int i = 0; i < n; i++) {
                char[] s = scanner.next().toCharArray();
                for (char ch : s) {
                    hash[i][ch - 'a'] = true;
                }
            }

            int left = 0;
            int right = n - 1;

            while (left < right) {
                if (!check(hash, left, right)) break;
                left++;
                right--;
            }

            if (left < right) System.out.println("No");
            else System.out.println("Yes");
        }

    }

    private static boolean check(boolean[][] hash, int left, int right) {
        for (int i = 0; i < 26; i++) {
            if (hash[left][i] && hash[right][i]) return true;
        }
        return false;
    }
}
